package com.zengqingfa.demo.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author zengqingfa
 * @date 2019/11/22 14:42
 * @description
 * @email zengqingfa_java@163.com
 *
 * 通过注解方式实现过滤器
 */
//@WebFilter(urlPatterns = "/*", filterName = "myFilter2")
public class MyFilter2 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("================进入过滤器MyFilter2======================");
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {

    }
}
